{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Alice 90\n",
      "Bob 98\n",
      "Charlie 80\n",
      "(('Alice', 90), ('Bob', 98), ('Charlie', 80))\n",
      "Alice 90\n",
      "Bob 98\n",
      "Charlie 80\n",
      "(('Alice', 90), ('Bob', 98), ('Charlie', 80))\n",
      "Alice 90\n",
      "Bob 98\n",
      "Charlie 80\n",
      "(('Alice', 90), ('Bob', 98), ('Charlie', 80))\n"
     ]
    }
   ],
   "source": [
    "names = ['Alice', \"Bob\", 'Charlie']\n",
    "scores = [90, 98, 80]\n",
    "\n",
    "for name, score in zip(names, scores):\n",
    "    print(name, score)\n",
    "\n",
    "print(tuple(zip(names, scores)))\n",
    "\n",
    "names = ['Alice', \"Bob\", 'Charlie','Peter']\n",
    "scores = [90, 98, 80]\n",
    "\n",
    "for name, score in zip(names, scores):\n",
    "    print(name, score)\n",
    "\n",
    "print(tuple(zip(names, scores)))\n",
    "\n",
    "names = ['Alice', \"Bob\", 'Charlie']\n",
    "scores = [90, 98, 80,100]\n",
    "\n",
    "for name, score in zip(names, scores):\n",
    "    print(name, score)\n",
    "\n",
    "print(tuple(zip(names, scores)))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Alice 90\n",
      "Bob 98\n",
      "Charlie 80\n",
      "Peter None\n",
      "(('Alice', 90), ('Bob', 98), ('Charlie', 80), ('Peter', None))\n"
     ]
    }
   ],
   "source": [
    "import itertools\n",
    "names = ['Alice', \"Bob\", 'Charlie','Peter']\n",
    "scores = [90, 98, 80]\n",
    "\n",
    "for name, score in itertools.zip_longest(names, scores):\n",
    "    print(name, score)\n",
    "\n",
    "print(tuple(itertools.zip_longest(names, scores)))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "base",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.11.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
